package type1;

/**
 * @projectName: com.xiayuanxing.designPattern
 * @className: type1.CurrentConditions
 * @author: xiayuanxing
 * @description: 显示当前天气情况（可以理解成是气象站自己的网站）
 * @date: 2022/1/7 15:49
 * @version: 1.0
 */
public class CurrentConditions {

    //温度
    private float temperature;
    //气压
    private float pressure;
    //湿度
    private float humidity;


    //更新天气情况，是由WeatherData来调用，我使用推送模式
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    //显示
    public void display(){
        System.out.println("***Today temperature:"+temperature+"***");
        System.out.println("***Today pressure:"+pressure+"***");
        System.out.println("***Today humidity:"+humidity+"***");
    }
}
